package com.ja.openchat.viewmodels;

import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;

import androidx.annotation.NonNull;

import com.blankj.utilcode.util.ToastUtils;
import com.ja.openchat.ui.NameAuthenNumberFragment;
import com.ja.openchat.ui.me.RechargeSuccessFragment;
import com.ja.openchat.views.VerificationCodeView;
import com.ja.openchat.views.VerifyPayPasswordDialog;
import com.lxj.xpopup.XPopup;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;
import me.goldze.mvvmhabit.binding.command.BindingConsumer;
import me.goldze.mvvmhabit.utils.KLog;

public class NameAuthenViewModel extends BaseViewModel {
    public NameAuthenViewModel(@NonNull Application application) {
        super(application);
    }
    public void submitData(String name, String cardNumber) {
        if (TextUtils.isEmpty(name)) {
            ToastUtils.showShort("请输入真实姓名");
            return;
        }
        if (TextUtils.isEmpty(cardNumber)) {
            ToastUtils.showShort("请输入身份证号码");
            return;
        }
        if (cardNumber.length() < 18) {
            ToastUtils.showShort("请输入正确的身份证号码");
            return;
        }
        Bundle bundle = new Bundle();
        bundle.putString("name", name);
        bundle.putString("number", cardNumber);
        startContainerActivity(NameAuthenNumberFragment.class.getCanonicalName(), bundle);
        finish();
    }
}
